﻿/*
   Copyright 2012 Dmitry Bratus

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Flower.Workflow
{
    /// <summary>
    /// The local sets builder interface.
    /// </summary>
    public interface ISetsBuilder
    {
        /// <summary>
        /// Defines a local set.
        /// </summary>
        /// <param name="name">
        /// Name of the set, so that the path to the set will be
        /// '/Sets/Local/[pid]/[name]'.
        /// </param>
        /// <param name="messageType">The message type of the set.</param>
        /// <param name="capacity">The capacity of the set (default is 0 i.e. unlimited).</param>
        /// <param name="acl">
        /// The action to build an ACL of the set.
        /// 
        /// If not specified, the set will be assigned the default ACL i.e. those who can start
        /// the workflow, can put to the set; those who see workflow, can read from the set.
        /// </param>
        /// <returns>Itself.</returns>
        ISetsBuilder Set
        (
            string name, 
            Type messageType, 
            int capacity = 0,
            Func<ISetPermissionBuilder, ISetPermissionBuilder> acl = null
        );
    }
}
